package com.example.tests;

import static org.testng.Assert.assertEquals;

import java.util.Collections;
import java.util.List;

import org.testng.annotations.Test;

public class GroupRemovalTests extends TestBase{

	@Test
	public void deleteSomeGroup() {
		app.getNavigationHelper().openMainPage();
	    app.getNavigationHelper().goToGroupsPage();
	    
	  //save old state
      List<GroupData> oldlist = app.getGroupHelper().getGroups();
      
	  //action
	  app.getGroupHelper().deleteGroup(0);
	  app.getGroupHelper().returnToGroupPage();
		
		 //save new state
	    List<GroupData> newlist = app.getGroupHelper().getGroups();
	    
	   // compare new state
	 
	    oldlist.remove(0);
	    Collections.sort(oldlist);
	    assertEquals(newlist, oldlist);
	    

	}

}
